<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:insert="~{include :: header('订单详情')}" />
    <th:block th:insert="~{include :: bootstrap-table-css}" />
</head>
<body class="hold-transition">
<div class="container-fluid mt-2 mb-2">
    <form class="form-horizontal" >
        <h4 class="form-header h4"  style="margin: 8px 10px 20px;border-bottom: 1px solid #e0e0e0">详细数据信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group row">
                    <label class="col-sm-4 col-form-label">订单ID</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" th:value="${order.orderId}" disabled>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group row">
                    <label class="col-sm-4 col-form-label">订单编号</label>
                    <div class="col-sm-8">
                        <input id="orderNo" class="form-control" type="text" th:value="${order.orderNo}" disabled>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group row">
                    <label class="col-sm-4 col-form-label ">支付商户订单号</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" th:value="${order.outTradeNo == null?'-':order.outTradeNo}" disabled>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group row">
                    <label class="col-sm-4 col-form-label ">用户昵称</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" th:value="${user.userName}" disabled>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group row">
                    <label class="col-sm-4 col-form-label ">用户邮箱</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" th:value="${user.email == null?'-':user.email}" disabled>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group row">
                    <label class="col-sm-4 col-form-label">用户手机</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" th:value="${user.mobile}" disabled>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group row">
                    <label class="col-sm-4 col-form-label">下单时间</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" th:value="${#strings.replace(order.createTime,'T',' ')}" disabled >
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group row">
                    <label class="col-sm-4 col-form-label">支付时间</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" th:value="${order.payTime == null?'-':#strings.replace(order.payTime,'T',' ')}" disabled>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group row">
                    <label class="col-sm-4 col-form-label">原始价</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" th:value="${order.payAmount / 100}" disabled>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group row">
                    <label class="col-sm-4 col-form-label">优惠金额</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" th:value="${order.couponAmount / 100}" disabled>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group row">
                    <label class="col-sm-4 col-form-label">优惠券编码</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" th:value="${couponCodeDTO.couponCode == null?'-':couponCodeDTO.couponCode}" disabled>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group row">
                    <label class="col-sm-4 col-form-label">支付类型</label>
                    <div class="col-sm-8">
                        <select name="authStatus" class="form-control m-b" th:with="type=${@dict.getType('qdx_order_payType')}" disabled>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="${order.payType}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group row">
                    <label class="col-sm-4 col-form-label">订单状态</label>
                    <div class="col-sm-8">
                        <select name="authStatus" class="form-control m-b" th:with="type=${@dict.getType('qdx_order_state')}" disabled>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="${order.status}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group row">
                    <label class="col-sm-4 col-form-label">订单备注</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" th:value="${order.description == null?'-':order.description}" disabled>
                    </div>
                </div>
            </div>
        </div>
        <h4 class="form-header h4" style="margin: 8px 10px 3px">详细内容信息</h4>
        <div class="container-fluid mt-2 mb-2">
            <div class="row">
                <div class="col-sm-12">
                    <table class="table table-striped">
                        <thead>
                        <tr>
                            <th style="width: 60px">id</th>
                            <th>标题</th>
                            <th style="width: 80px">类型</th>
                            <th style="width: 80px">原价</th>
                            <th style="width: 80px">销售价</th>
                            <th style="width: 200px">过期时间</th>
                            <th style="width: 300px">描述</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="detail : ${orderDetails}">
                            <td th:text="${detail.id}"></td>
                            <td th:text="${detail.courseName}"></td>
                            <td>
                                <span class="badge bg-blue" th:if="${detail.orderType=='COURSE'}">课程</span>
                                <span class="badge bg-green" th:if="${detail.orderType=='MEMBER'}">会员</span>
                                <span class="badge bg-danger" th:if="${detail.orderType=='ACCOUNT'}">充值</span>
                            </td>
                            <td><s><span class="text-red" th:text="${detail.sourcePrice}">0</span></s></td>
                            <td><span class="text-red" th:text="${detail.price}">0</span></td>
                            <td th:text="${#strings.replace(detail.authDate,'T',' ')}"></td>
                            <td th:text="${detail.description}"></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:insert="~{include :: footer}" />
</body>
</html>